Repository navigation
Conversation
AUTH_TYPE, AUTH_CHANNEL and AUTH_PASSKEY move from the web env to the API env and are exposed via /1/meta. The web loads meta before rendering (also when logged out) and derives the login/signup forms and passkey UI from it. Passkey was previously only a client-side toggle: the API routes were always live. They now return 403 when AUTH_PASSKEY is off. The Settings passkey card is hidden when passkey is disabled, so users can't register a passkey they can't sign in with. Removes the unused OptionalPassword component.
API ChangesNo changes. |
Collaborator
|
there's an argument for API being single source of truth but there's also an argument for "API handles everything and what is enabled is a client side concern" we defaulted to the former - it was a choice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
AUTH_TYPE,AUTH_CHANNEL,AUTH_PASSKEYmove fromservices/web/.envtoservices/api/.env(defaults:password,email,true).GET /1/metareturnsauth: { type, channel, passkey }./1/auth/passkey/*returns 403 whenAUTH_PASSKEYis off./1/metafirst (also when logged out); a failure shows the error screen.meta.auth.OptionalPasswordcomponent.Why
Passkey login was never offered because the web flag defaulted to empty, while Settings still let users register passkeys. The flag was also client-only: the API passkey routes were always live regardless of it. The API is now the single source of truth.
Reviewer notes
.env, so they inherit passkey on unless overridden.type/channelfrom the request body; the web now sends the API's configured values, but the API does not enforce them.AUTH_*vars; API deploys do if they differ from the defaults.Testing
passkey-disabled.test.jsand updatedmeta.test.js.